package com.googlecode.rulio.predicates;


import com.googlecode.rulio.Predicate;

public class OfTypePredicate<T> extends Predicate<T> {
    private final Class<? extends T> type;

    OfTypePredicate(Class<? extends T> type) {
        this.type = type;
    }

    public boolean matches(T t) {
        return type.isInstance(t);
    }

    public Class<? extends T> type() {
        return type;
    }
}
